package org.example.controller;

import org.example.entity.User;
import org.example.mapper.UserMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xuan
 * @create 2024/4/23
 */
@RestController
public class UserController {
    @Resource
    private UserMapper userMapper;

    @GetMapping("/getUser")
    public User getUserById(int id) {
        return userMapper.getUserById(id);
    }

    @GetMapping("/selectAll")
    public List<User> selectAll() {
        return userMapper.selectAll();
    }

}
